package data.connector.rippling.controller;

import data.connector.rippling.constant.API;
import jdk.jfr.ContentType;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/rippling")
@RequiredArgsConstructor
public class DataRipplingController {




    @GetMapping("apilist")
    public List<String> apiList() {
        List<String> list = new ArrayList<>();

        list.add(API.COMPANIES_CURRENT);
        list.add(API.COMPANY_ACTIVITY);
        list.add(API.COMPANY_DEDUCTIONS);
        list.add(API.CUSTOM_FIELDS);
        list.add(API.DEPARTMENTS);
        list.add(API.EMPLOYEE_DEDUCTIONS);
        list.add(API.EMPLOYEES);
        list.add(API.LEAVE_REQUESTS);
        list.add(API.LEVELS);
        list.add(API.PAY_SCHEDULES);

        return list;
    }




    /**
     * {
     *
     * "tenantId":1001
     *
     * }
     *
     * @param params
     */
    @PostMapping("synchronise")
    public void synchronise(@RequestBody Map<String, Object> params){
//        timedTaskScheduled.manualSynchronise(params);
    }


    /**
     *
     * {
     *
     * "tenantId":1001,
     * "onoff":"ON"
     *
     * }
     *
     * @param params
     */
    @PostMapping("onoff")
    public void onoff(@RequestBody Map<String, Object> params){
//        timedTaskScheduled.manualOffSynchronise(params);
    }

}
